package ibm.cognos.imt.template

import groovy.xml.MarkupBuilder

/**
 * Created with IntelliJ IDEA.
 * User: eric
 * Date: 5/8/14
 * Time: 5:53 PM
 * To change this template use File | Settings | File Templates.
 */
abstract class AbstractTemplate {
    def root
    def specStr
    def sw
    def builder

    def String getSpecStr() {
        if (specStr == null) {
            sw = new StringWriter()
            builder = new MarkupBuilder(sw)
            generateTemplateSpec(builder)
            specStr = sw.toString()
        }
        specStr
    }

    def abstract generateTemplateSpec(MarkupBuilder builder)

    def abstract getTemplateNode()

}
